package com.pallass.admin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pallass.admin.domain.SysResource;
import com.pallass.admin.repository.SysResourceRepository;
import com.pallass.admin.service.SysResourceService;
import com.pallass.common.repository.BaseRepository;
import com.pallass.common.service.BaseServiceImpl;

@Service("resourceService")
public class SysResourceServiceImpl extends BaseServiceImpl<SysResource, Integer> implements SysResourceService {

	@Autowired
	private SysResourceRepository sysResourceDAO;

	public BaseRepository<SysResource, Integer> getBaseDao() {
		return this.sysResourceDAO;
	}

	public List<SysResource> findAllWithoutButton() {
		return sysResourceDAO.findAllWithoutButton();
	}

	@Override
	public List<SysResource> obtainResources(Integer userId) {
		return sysResourceDAO.findMenuByUserId(userId);
	}

	@Override
	public List<String> findPermissionsByUserId(Integer userId) {
		return sysResourceDAO.findPermissionsByUserId(userId);
	}

}
